<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改学员信息</title>
    <style>
        span{
            color: red;
            font-size: 12px;
        }
    </style>
</head>
<body>
<form id="login" action="student" method="POST" enctype="multipart/form-data">
    <table border="1px" cellpadding="10px" cellspacing="0" align="center" width="500px">
        <caption><h2>修改学员信息</h2></caption>
        <tr>
            <td>姓名</td>
            <td>
                <input type="text" name="sname" value="${stu.sname}">
                <!--
                隐藏域绑定要执行的方法名
                -->
                <input type="hidden" name="method" value="updateStudent">
                <input type="hidden" name="sid" value="${stu.sid}">
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td>
                <input type="radio" name="sex" value="男" <c:if test="${stu.sex == '男'}">checked</c:if>>男
                <input type="radio" name="sex" value="女" <c:if test="${stu.sex == '女'}">checked</c:if>>女
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td>
                <input type="text" name="age" value="${stu.age}">
            </td>
        </tr>
        <tr>
            <td>学历</td>
            <td>
                <select name="degree">
                    <option value="专科" <c:if test="${stu.degree == '专科'}">selected</c:if>>专科</option>
                    <option value="本科" <c:if test="${stu.degree == '本科'}">selected</c:if>>本科</option>
                    <option value="硕士" <c:if test="${stu.degree == '硕士'}">selected</c:if>>硕士</option>
                    <option value="博士" <c:if test="${stu.degree == '博士'}">selected</c:if>>博士</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>头像</td>
            <td>
                <input type="file" name="pic">
                <%--保存旧头像--%>
                <input type="hidden" name="oldpic" value="${stu.pic}">
            </td>
        </tr>
        <tr>
            <td>备注</td>
            <td>
                <textarea name="mark" rows="4" cols="40">${stu.mark}</textarea>
            </td>
        </tr>
        <tr align="center">
            <td colspan="2">
                <input type="submit" value="修改">
                <input type="button" id="back" value="返回">
            </td>
        </tr>
    </table>
</form>
</body>
</html>

